package com.xhs.controller;

import com.xhs.dto.request.TagsParams;
import com.xhs.message.ReturnResult;
import com.xhs.service.TagsService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @desc:
 * @projectName: spring-boot-demo
 * @author: xhs
 * @date: 2025-03-22 周六 13:36
 * @version: JDK 1.8
 */
@RestController
@RequestMapping("/tags")
public class TagsController {

    @Resource
    private TagsService tagsService;

    /**
     * 根据标签查询
     *
     * @param param 入参
     * @return ReturnResult
     */
    @PostMapping("/getTags")
    public ReturnResult<Object> getTags(@Valid @RequestBody TagsParams param) {
        return tagsService.getTags(param.getTagsName(), param.getTagelist());
    }
}
